package com.changgou.goods.feign;

import com.changgou.entity.Result;
import com.changgou.goods.pojo.Sku;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @author BAO
 * @version V1.0
 * @Package com.changgou.goods.feign
 * @date 2020/12/9 18:33
 * @description:
 */
@RequestMapping("/sku")
@FeignClient(name = "goods")
public interface SkuFeign {

    @GetMapping("/search")
    Result findList(@RequestParam Map searchMap);

    /**
     * 根据商品id查询对应的库存集合数据
     * @param spuId
     * @return
     */
    @GetMapping("/spu/{spuId}")
    public List<Sku> findListBySpuId(@PathVariable("spuId") String spuId);
}
